//
//  GHDocterController.m
//  guahao
//
//  Created by osx on 16/10/5.
//  Copyright © 2016年 osx. All rights reserved.
//

#import "GHDocterController.h"

@interface GHDocterController ()


@end

static NSString *reuseIdentifier = @"GHDocterreuseIdentifier";

@implementation GHDocterController


- (void)viewDidLoad {
    [super viewDidLoad];
    
    
    
    [self.tableView registerClass:[UITableViewCell class] forCellReuseIdentifier:reuseIdentifier];
    [self.tableView reloadData];
}


#pragma mark - Table view data source

- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView {
#warning Incomplete implementation, return the number of sections
    return 1;
}

- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
#warning Incomplete implementation, return the number of rows
    return self.array.count;
}


- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
    UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:reuseIdentifier forIndexPath:indexPath];
    
    if (!cell) {
        cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:reuseIdentifier];
        
    }
    cell.textLabel.text = self.array[indexPath.row];
    return cell;
}

-(void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath{
    
    NSLog(@"%@---",self.array[indexPath.row]);
    NSString *str = self.array[indexPath.row];
    NSInteger i = 1;
    NSDictionary *dict = [NSDictionary dictionaryWithObjectsAndKeys:self.title,@"name",str,@"title", nil];
    [[NSNotificationCenter defaultCenter] postNotificationName:@"setButtonTitleName" object:nil userInfo:dict];
    
    [self.navigationController popViewControllerAnimated:YES];
}

@end